From: Lars Ingebrigtsen Date: Thu, 8 Jul 2021 14:33:28 +0000 (+0200) Subject: Make desktop-kill more robust X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~18^2~2171 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=8ab0c04c2c77260e2342515151ed75a87907c007;p=emacs.git Make desktop-kill more robust * lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we can't delete the desktop file (bug#20762). --- diff --git a/lisp/desktop.el b/lisp/desktop.el index ae8d026acc4..b9467c87527 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -759,7 +759,10 @@ is nil, ask the user where to save the desktop." (unless (yes-or-no-p "Error while saving the desktop. Ignore? ") (signal (car err) (cdr err)))))) ;; If we own it, we don't anymore. - (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock)) + (when (eq (emacs-pid) (desktop-owner)) + ;; Allow exiting Emacs even if we can't delete the desktop file. + (ignore-error 'file-error + (desktop-release-lock))) t) ;; ----------------------------------------------------------------------------